import { defHttp } from '../http'
import type { CommonAPI } from '../model/_utils'

/**登录 */
export const signInApi = data =>
  defHttp.post('/api/login', { data }, { isTransformResponse: false })
/**退出 */
export const signOutApi = () => defHttp.post('/api/logout', {})

/**修改密码 */
export const changePasswordApi: CommonAPI<
  '/api/user/password',
  'post'
> = data =>
  defHttp.post('api/user/password', { data }, { isTransformResponse: false })
/**更新用户 */
export const updateUserApi: CommonAPI<'/api/user', 'post'> = data =>
  defHttp.post('api/user', { data })
/**获取用户 */
export const getUserApi: CommonAPI<'/api/user', 'get'> = params =>
  defHttp.get('api/user', { params })
